<div class="common-document-outer">
  <div class="folder-table-container">
    <div class="pa-form-container shadowbox"
      style="background-color: #ffffff;">
      <div class="container-header">查询条件</div>
      <div class="pa-form-content">
        <form class="clear">
          <div class="row row-top clear">
            <div class="pa-form-control fl">
              <label for="equipment">档案号：</label>
              <input type="text" 
                ng-model="queryData.archiveNo">
            </div>
            <div class="pa-form-control fl">
              <label for="equipment">文档题名：</label>
              <input type="text"
                ng-model="queryData.archiveName">
            </div>
            <div class="pa-form-control fl">
              <label for="equipment">标段：</label>
              <select
                ng-model="queryData.markSection">
                <option value=""></option>
                <option value="{{item.bidId}}"
                  ng-repeat ="item in sectionList">
                  {{item.bidName}}
                </option>
              </select>
            </div>
          </div>
          <a class="pa-float-btn reset-btn" ng-click="reset()">
            <i class="fa fa-repeat"></i>
            <span class="m11">重置</span>
          </a>
          <a class="pa-float-btn btn" ng-click="initViewModel()">
            <i class="fa fa-search"></i>
            <span class="m11">查询</span>
          </a>
        </form>
      </div>
    </div>
    <div class="pa-table-container shadowbox clear">
    <div class="next-header">该分类下共计<span>{{total}}</span>个文件</div>
    <div class="operation-bar">
      <a
        class="pa-float-btn huiyi"
        authorization-btn="api/safesite/officeworkdata/saveRecord"
        ng-click="newData()">
        上传档案
      </a>
      <!-- <a class="pa-float-btn huiyi">批量下载</a> -->
      <div class="table-outer" style="margin-top: 14px;">
        <table class="pa-table">
          <thead>
            <tr>
              <th><input type="checkbox" class="form-control-box" />全选</th>
              <th>档案号</th>
              <th>文档题名</th>
              <th>所属标段</th>
              <th class="time-sequence">
                <div>创建时间</div>
                <div class="time-sequence-btn">
                  <div class="time-sequence-box"
                    ng-click="up('0')">
                    <i class="fa fa-caret-up"></i>
                  </div>
                  <div class="time-sequence-box"
                    ng-click="up('1')">
                    <i class="fa fa-caret-down"></i>
                  </div> 
                </div>
              </th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
          <tr ng-repeat="item in documentList">
            <td><input type="checkbox" class="form-control-box" /></td>
            <td>{{item.archiveNo}}</td>
            <td>{{item.archiveName}}</td>
            <td>{{item.markSectionName}}</td>
            <td>{{item.createTime1}}</td>
            <td>
              <div class="edit-item del" style="display:inline-block"
                authorization-btn="api/safesite/officeworkdata/selectByPrimaryKey"
                ng-click="getArchiveDetail(item.recordno)">
                <a class="a-color">
                  <i class="fa fa-street-view color"></i>
                  <span>查看</span>
                </a>
              </div>
              <div class="edit-item del" style="display:inline-block"
                authorization-btn="api/safesite/officeworkdata/selectByPrimaryKey"
                ng-click="editData(item.recordno)">
                <i class="fa fa-pencil color"></i>
                <span>编辑</span>
              </div>
              <div class="edit-item del" style="display:inline-block"
                authorization-btn="api/safesite/officeworkdata/delete"
                ng-click="deleteInformation(item.recordno)">
                <i class="fa fa-trash color"></i>
                <span>删除</span>
              </div>
            </td>
          </tr>
          </tbody>
        </table>
        <div class="total-num">
          共计<span class="total-num-colorful">
          {{paginationData.total}}</span>条
        </div>
        <!--分页-->
        <div class="pagination-outer">
          <uib-pagination
            total-items="paginationData.total"
            ng-model="paginationData.pageNum"
            items-per-page="paginationData.pageSize"
            ng-change="pageChange()"
            class="pagination-sm"
            boundary-link-numbers="true"
            max-size="5"
            next-text="下一页"
            previous-text="上一页"></uib-pagination>
        </div>
      </div>
    </div>
  </div>
  <!--上传档案信息-->
  <script type="text/ng-template" id="documentItemMgt">
    <div class="item-detail-dialog training-tech">
      <div class="item-detail-dialog-header">
        <div class="title-txt">
          <span>上传档案</span>
        </div>
      </div>
      <div class="item-detail-dialog-content">
        <form name="addForm" novalidate>
          <div class="row-item">
            <div class="fixed-left-label"><b>*</b>档案号：</div>
            <div class="right-value">
              <input type="text" name="archiveNo" required 
                ng-model="officeDataAddCtrl.category.archiveNo"/>
            </div>
            <span class="error-tip"
              ng-show="(addForm.$submitted || addForm.archiveNo.$dirty) && addForm.archiveNo.$error.required">
              必填
            </span>
          </div>
          <div class="row-item">
            <div class="fixed-left-label"><b>*</b>案卷题名：</div>
            <div class="right-value">
              <input type="text" name="archiveName" required 
                ng-model="officeDataAddCtrl.category.archiveName"/>
            </div>
            <span class="error-tip"
              ng-show="(addForm.$submitted || addForm.archiveName.$dirty) && addForm.archiveName.$error.required">
              必填
            </span>
          </div>
          <div class="row-item">
            <div class="fixed-left-label">时间：</div>
            <div class="right-value">
              <input type="text" ng-datepicker
                ng-model="officeDataAddCtrl.category.completionTime"/>
            </div>
          </div>
          <div class="row-item">
            <div class="fixed-left-label"><b>*</b>所属标段：</div>
            <div class="right-value">
              <select type="text" name="markSection" required
                ng-model="officeDataAddCtrl.category.markSection"
                ng-options="item.bidId as item.bidName for item in officeDataAddCtrl.sectionList">
                <option value=""></option>
              </select>
            </div>
            <span class="error-tip"
              ng-show="(addForm.$submitted || addForm.markSection.$dirty) && addForm.markSection.$error.required">
              必填
            </span>
          </div>
          <div class="row-item">
            <div class="fixed-left-label">相关说明：</div>
            <div class="right-value">
              <textarea 
                ng-model="officeDataAddCtrl.category.relatedDesc" 
                style="width:188px;height:58px;border-radius: 4px;">
              </textarea>
            </div>
          </div>
          <div class="row-item">
            <div class="fixed-left-label">编制单位：</div>
            <div class="right-value">
              <input type="text" name="organization"
                ng-model="officeDataAddCtrl.category.organization"/>
            </div>
          </div>
        <div>
          <common-attachment-upload
            component-id="cp2"
            file-type="file"
            pick-btn-id="avatar_attachment_picker"
            upload-url="{{fileUploadUrl.officeWorkData}}"
            file-list="officeDataAddCtrl.category.fileBeanList"
            is-uploading="isUploading"></common-attachment-upload>
        </div>
        </form>        
      </div>
      <div class="item-detail-dialog-footer">
        <a class="pa-btn" ng-click="officeDataAddCtrl.submit(addForm)">
          <i class="fa fa-save"></i>
          <span>确定</span>
        </a>
        <a class="pa-btn" ng-click="closeThisDialog()">
          <i class="fa fa-times"></i>
          <span>取消</span>
        </a>
      </div>
    </div>
  </script>
  <!-- 查看档案信息 -->
  <script type="text/ng-template" id="archiveDetail">
    <div class="item-detail-dialog training-tech">
      <div class="item-detail-dialog-header">
        <div class="title-txt">
          <span>查看档案信息</span>
        </div>
      </div>
      <div class="item-detail-dialog-content">
        <div class="row-item">
          <div class="fixed-left-label">案卷题名：</div>
          <div class="right-value">
            <div class="line">
              <span>{{archiveDetail.archiveName}}</span>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">档案号：</div>
          <div class="right-value">
            <div class="line">
              <span>{{archiveDetail.archiveNo}}</span>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">时间：</div>
          <div class="right-value">
            <div class="line">
              <span>{{archiveDetail.completionTime | date: 'yyyy-MM-dd'}}</span>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">上传人：</div>
          <div class="right-value">
            <div class="line">
              <span>{{archiveDetail.uploaderName}}</span>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">所属标段：</div>
          <div class="right-value">
            <div class="line">
              {{archiveDetail.markSectionName}}
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">编制单位：</div>
          <div class="right-value">
            <div class="line">
              {{archiveDetail.organization}}
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">相关说明：</div>
          <div class="right-value">
            <div class="line">
              <span>{{archiveDetail.relatedDesc}}</span>
            </div>
          </div>
        </div>
        <div class="avatar-attachment-upload-outer" style="float: left; width: 100%; padding-left: 41px; margin-top: 0;">
          <div class="file-list-outer">
            <div class="file-item" ng-repeat="item in archiveDetail.fileBeanList">
              <span class="upload-file-name">{{item.fileName}}</span>
              <a class="pa-btn" ng-click="preview(item, archiveDetail)">预览</a>
              <a class="pa-btn" target="_blank" 
                ng-href="{{getDownloadSrc(item)}}">
                  下载
              </a>
            </div>
          </div>
        </div>
      </div>
      <div class="item-detail-dialog-footer" ng-click="closeThisDialog()">
        <a class="pa-btn">
          <i class="fa fa-save"></i>
          <span>确定</span>
        </a>
        <a class="pa-btn" ng-click="closeThisDialog()">
          <i class="fa fa-times"></i>
          <span>取消</span>
        </a>
      </div>
    </div>
  </script>
  <!--编辑档案信息-->
  <script type="text/ng-template" id="editDocumentItemMgt">
    <div class="item-detail-dialog training-tech">
      <div class="item-detail-dialog-header">
        <div class="title-txt">
          <span>编辑档案信息</span>
        </div>
      </div>
      <div class="item-detail-dialog-content">
        <div class="row-item">
          <div class="fixed-left-label">案卷题名：</div>
          <div class="right-value">
            <div class="line">
              <input type="text" class="form-control"  ng-model="editeditDocument.archiveName"/>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">档案号：</div>
          <div class="right-value">
            <div class="line">
              <input type="text" class="form-control"
                ng-model="editeditDocument.archiveNo"/>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">时间：</div>
          <div class="right-value">
            <div class="line">
              <input type="text" ng-datepicker class="form-control"  ng-model="editeditDocument.completionTime"/>
            </div>
          </div>
        </div>
        
        <div class="row-item">
          <div class="fixed-left-label">上传人：</div>
          <div class="right-value">
            <div class="line">
              <input type="text" class="form-control" disabled
                ng-model="editeditDocument.uploaderName"/>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">所属标段：</div>
          <div class="right-value">
            <div class="line">
              <select type="text" class="form-control" required
                ng-model="editeditDocument.markSection"
                ng-options="item.bidId as item.bidName for item in sectionList">
                <option value=""></option>
              </select>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">编制单位：</div>
          <div class="right-value">
            <div class="line">
              <input type="text" class="form-control"  ng-model="editeditDocument.organization"/>
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="fixed-left-label">相关说明：</div>
          <div class="right-value">
            <div class="line">
              <textarea ng-model="editeditDocument.relatedDesc" style="width:188px;height:58px;border-radius: 4px;"></textarea>
            </div>
          </div>
        </div>
        <div>
          <common-attachment-upload
            component-id="cp2"
            file-type="file"
            pick-btn-id="avatar_attachment_picker"
            upload-url="{{fileUploadUrl.officeWorkData}}"
            file-list="editeditDocument.fileBeanList"></common-attachment-upload>
        </div>
      </div>
      <div class="item-detail-dialog-footer" ng-click="submit()">
        <a class="pa-btn">
          <i class="fa fa-save"></i>
          <span>确定</span>
        </a>
        <a class="pa-btn" ng-click="closeThisDialog()">
          <i class="fa fa-times"></i>
          <span>取消</span>
        </a>
      </div>
    </div>
  </script>
</div>